﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.AspNet.SignalR;

namespace ERPStore.Web.NewsLetters
{
	public class NewsLetterConnection : PersistentConnection, ERPStore.Services.IPersistentConnection
	{
		protected override bool AuthorizeRequest(IRequest request)
		{
			var apiKey = request.Headers["apikey"];
			return GlobalConfiguration.Configuration.Settings.ApiToken.Equals(apiKey);
		}

		public string Url
		{
			get { return "newsletters"; }
		}
	}
}
